import paramiko

# 请求服务器获取信息
def Kp2pGET():
    ssh = paramiko.SSHClient()
    ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
    ssh.connect('192.168.xx.xx', 22, 'root', 'pwd')
    stdin, stdout, stderr = ssh.exec_command('pwd')
    str1 = stdout.read().decode('utf-8')
    print(str1)
    ssh.close()


if __name__ == '__main__':
    Kp2pGET()